
ls_score = ["及格", "优秀", "良好", "优秀", "及格", "不及格", "良好", "及格",
            "良好", "不及格", "良好", "良好", "良好", "及格", "及格", "优秀",
            "优秀", "良好", "不及格", "良好", "及格", "良好", "及格", "优秀"]

score_levels = [["优秀",0], ["良好",0], ["及格",0], ["不及格",0]]


for score in ls_score:
    if score == "优秀":
        score_levels[0][1] += 1
    elif score == "良好":
        score_levels[1][1] += 1
    elif score == "及格":
        score_levels[2][1] += 1
    elif score == "不及格":
        score_levels[3][1] += 1

sorted_score_levels = sorted(score_levels, key=lambda x: x[1], reverse=True)
for level, count in sorted_score_levels:
    print(f"{level} : {count}")
